package com.whut.mapper;

import com.whut.model.Problemcollect;
import com.whut.v_model.*;

import java.util.ArrayList;
import java.util.List;

public interface ProblemcollectMapper {
    int deleteByPrimaryKey(Integer mkey);

    int insert(Problemcollect record);

    int insertSelective(Problemcollect record);

    Problemcollect selectByPrimaryKey(Integer mkey);

    int updateByPrimaryKeySelective(Problemcollect record);

    int updateByPrimaryKey(Problemcollect record);

    int getCountRiskPointByType(String riskPoint, int projectId, String startTime, String endTime);

    /*my methods*/
    Problemcollect selectByLastIdAndCheckId(int lastId, int checkId);

    List<ProblemCollectWithPD> getTLExamineList(int checkId, int fourthId);
    List<ProblemCollectWithPD> getNewTLExamineList(int checkId, int fourthId);

    List<RiskPointSum> getStaticsByContractId(int contractId);

    TimesStat getStatByProjectAndTime(int projectId, String st, String et);

    /**
     * 本来这个获取本次以及上次检查1-5级隐患数量的数据对比
     *
     * @param projectId 工程Id
     * @return java.util.List<com.whut.v_model.TimesStat>
     * @author fuzhenjie
     * @date 20.1.1 13:46(GMT)
     */
    List<TimesStat> getCurAndLastStatByProjectId(int projectId);


    /**
     * 通过工程Id和类型（安全；质量；文明）来获取最近三次的1-5级的隐患数量的数据对比
     *
     * @param projectId 工程Id
     * @param type      1 安全；2 质量；3文明
     * @return java.util.List<com.whut.v_model.TimesStat>
     * @author fuzhenjie
     * @date 20.1.1 13:48(GMT)
     */
    List<TimesStat> getTop3StatByProjectIdAndType(int projectId, int type);

    /**
     * 比较周期中的五种隐患的信息
     *
     * @param list
     * @return java.util.List<com.whut.v_model.CTASummary>
     * @author fuzhenjie
     * @date 20.1.1 19:56(GMT)
     */
    List<CTASummary> getCTASummaryStat(List<Integer> list, int type);

    List<ProblemNumSearch1> getProblemSearch1Info(List<Integer> list, int number, int size);

    List<CheckFourthPoint> getCheckFourthPoint(int checkId);

    TimesStat getRiskPointStaProNum(List<Integer> list, int number, String idType);


    List<Problemcollect> getProblemsByForthId(Integer fourthId);

    List<Problemcollect> getRiskWarning(Integer contractId);

    Integer getProblemNumByForthId(Integer fourthId, List<Integer> list);


    List<Problemcollect> getProblemsBycheckId(Integer checkId);

    List<Object> getProblemsByContractId(Integer contractId);

    Problemcollect getTimeInterval(Integer contractId, Integer firstId);

    List<Integer> getAllSecondIdByCheck(int checkId, int number);

    ArrayList selectProblem(String name);

    Integer selectProblemNum(String projectName, Integer num);

    /**
     * @author： wenyihan
     * @description：通过mkey和lastid寻找对应的problemQua
     * @date： 11:50 2020/10/30
     * @param： [mkey, lastId]
     * @return： java.lang.String
    */
    String findProblemQuaByMkeyAndLastId(Integer mkey, Integer lastId);

    List<Integer> getSixthIdByRemark(String remark);

    int selectProblemNumByCheckId(int checkId);

    int getIsNew(int checkId);

    List<Problemcollect> getByLikeCharacter(char character,int checkId);
}